package shejimoshi.zhongjiezhemoshi;
// 具体同事类B
public class ConcreteColleagueB implements Colleague {
    private String name;
    private Mediator mediator;

    public ConcreteColleagueB(String name, Mediator mediator) {
        this.name = name;
        this.mediator = mediator;
    }

    @Override
    public void send(String message) {
        mediator.relay(name, message);
    }

    @Override
    public void receive(String message) {
        System.out.println(name + " received message: " + message);
    }
}
